home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 955 b | 50 lines | [TEXT/R*ch] |
- --<<<
- -- Kaleida Labs, Inc.
- -- Field Guide to the ScriptX Language
- -- chapter 9, example 8
-
- -- set up XYZ
- module XYZ
- uses ScriptX
- exports x, y, z
- end
- in module XYZ
- global x:10, y:"foo", z:#(56,567)
-
- -- set up XYZexport, which exports its own variables (a and b),
- -- imports everything from XYZ, renames x to be otherX
- -- and transitively exports otherX and y
-
- module XYZexport
- exports a, b
- uses ScriptX
- uses XYZ with
- imports everything
- renames x:otherX
- exports otherX, y
- end
- end
- in module XYZexport
- global a := "croissant"
- global b := pi
- print otherX
- 10
-
- -- Finally, this module uses XYZexport and imports all. The
- -- variables that get imported should be y (from XYZ), otherX
- -- (which is actually x from XYZ) and a and b (from XYZexport)
-
- module moreXYZexport
- uses ScriptX
- uses XYZexport with
- imports everything
- end
- end
- in module moreXYZexport
- print a
- print b
- print y
- print otherX
- -- this should generate an exception
- print x
- -->>>